/* 
 * File:   globalInit.h
 * Author: ferranferri
 *
 * Created on May 8, 2013, 4:09 PM
 */
#pragma once
#ifndef _Z3D_VFS_TEST_GLOBALINIT_H
#define	_Z3D_VFS_TEST_GLOBALINIT_H

#include <gtest/gtest.h>
#include "Log/LogSystem.h"
#include "vfs/vfs.h"

class VFS_Environment: public ::testing::Environment{
 public:
  virtual ~VFS_Environment() {}
  // Override this to define how to set up the environment.
  virtual void SetUp() {
    // iniciando sistema de logs.
    glog::CGlobalLog::initSingleton();
    boost::shared_ptr<glog::IListener> lis(new glog::CLogWriter("Log.txt", glog::LOGLEVEL_DEBUG));
    glog::CGlobalLog::getSingleton().addListener(lis, VFS_APPENDER);
  }
  // Override this to define how to tear down the environment.
  virtual void TearDown() {
      glog::CGlobalLog::getSingleton().processMessages();
      glog::CGlobalLog::destroySingleton();
  }
};

::testing::Environment* const foo_env = ::testing::AddGlobalTestEnvironment(new VFS_Environment);

#endif	/* _Z3D_VFS_TEST_GLOBALINIT_H */

